import { defineConfig } from 'vite'
import {resolve} from 'path'
import vue from '@vitejs/plugin-vue'
import AutoImport from 'unplugin-auto-import/vite';
import Components from 'unplugin-vue-components/vite';
import { VantResolver } from '@vant/auto-import-resolver';
// https://vite.dev/config/
export default defineConfig({
    build: {
      minify: 'terser',
      terserOptions: {
        compress: {
          //生产环境时移除console
          drop_console: true,
          // drop_console: false,
          drop_debugger: true,
        },
      },
    },
  resolve: {
    alias: {
      "@": resolve(__dirname, 'src'), // 路径别名
    },
    extensions: ['.js', '.json', '.ts'] // 使用路径别名时想要省略的后缀名，可以自己 增减
  }
  ,
  plugins: [vue()],
  server:{
    port:5173,
    proxy :{
      '/api':{
        target:  process.env.NODE_ENV === " production" ? 'http://friend-match' :'http://localhost:8081 ',
        changeOrigin:true,
      }
    }
  }
}
)



